﻿using LogException;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LogException
{
    /// <summary>
    /// UI线程异常处理类
    /// </summary>
    public class UIException
    {
        /// <summary>
        /// UI线程异常处理函数：先记录异常后显示提示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public static void ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            Exception ex = e.Exception;
            LogUtil.WriteLog_Error(sender.GetType(), ex);
            new ErrorForm(ex).Show();
        }
    }
}
